\(\int \frac {3+x^2}{(1+x^2)^2} \, dx\) [113]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 14 \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=\frac {x}{1+x^2}+2 \arctan (x) \]

[Out]

x/(x^2+1)+2*arctan(x)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {393, 209} \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=2 \arctan (x)+\frac {x}{x^2+1} \]

[In]

Int[(3 + x^2)/(1 + x^2)^2,x]

[Out]

x/(1 + x^2) + 2*ArcTan[x]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 393

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
 + 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {x}{1+x^2}+2 \int \frac {1}{1+x^2} \, dx \\ & = \frac {x}{1+x^2}+2 \tan ^{-1}(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=\frac {x}{1+x^2}+2 \arctan (x) \]

[In]

Integrate[(3 + x^2)/(1 + x^2)^2,x]

[Out]

x/(1 + x^2) + 2*ArcTan[x]

Maple [A] (verified)

Time = 2.55 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.07

method result size
default \(\frac {x}{x^{2}+1}+2 \arctan \left (x \right )\) \(15\)
risch \(\frac {x}{x^{2}+1}+2 \arctan \left (x \right )\) \(15\)
meijerg \(-\frac {x}{2 \left (x^{2}+1\right )}+2 \arctan \left (x \right )+\frac {3 x}{2 x^{2}+2}\) \(28\)
parallelrisch \(-\frac {i \ln \left (x -i\right ) x^{2}-i \ln \left (x +i\right ) x^{2}+i \ln \left (x -i\right )-i \ln \left (x +i\right )-x}{x^{2}+1}\) \(52\)

[In]

int((x^2+3)/(x^2+1)^2,x,method=_RETURNVERBOSE)

[Out]

x/(x^2+1)+2*arctan(x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.36 \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=\frac {2 \, {\left (x^{2} + 1\right )} \arctan \left (x\right ) + x}{x^{2} + 1} \]

[In]

integrate((x^2+3)/(x^2+1)^2,x, algorithm="fricas")

[Out]

(2*(x^2 + 1)*arctan(x) + x)/(x^2 + 1)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.71 \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=\frac {x}{x^{2} + 1} + 2 \operatorname {atan}{\left (x \right )} \]

[In]

integrate((x**2+3)/(x**2+1)**2,x)

[Out]

x/(x**2 + 1) + 2*atan(x)

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=\frac {x}{x^{2} + 1} + 2 \, \arctan \left (x\right ) \]

[In]

integrate((x^2+3)/(x^2+1)^2,x, algorithm="maxima")

[Out]

x/(x^2 + 1) + 2*arctan(x)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=\frac {x}{x^{2} + 1} + 2 \, \arctan \left (x\right ) \]

[In]

integrate((x^2+3)/(x^2+1)^2,x, algorithm="giac")

[Out]

x/(x^2 + 1) + 2*arctan(x)

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \frac {3+x^2}{\left (1+x^2\right )^2} \, dx=2\,\mathrm {atan}\left (x\right )+\frac {x}{x^2+1} \]

[In]

int((x^2 + 3)/(x^2 + 1)^2,x)

[Out]

2*atan(x) + x/(x^2 + 1)